<?php

function smarty_function_url($params, $template)
{
    require_once(SMARTY_PLUGINS_DIR . 'shared.escape_special_chars.php');
    $ctl = '';
    $act = '';
    $str_params = '';
    
    foreach($params as $_key => $_val) {
        switch ($_key) {
            case 'ctl':
                $$_key = $_val;
                break;
            break;
            case 'act':
                $$_key = $_val;
                break;
            break;
            default:    
                $str_params .= '&'.$_key.'='.$_val;
                break;
            break;
        } 
    } 
    
    echo site_url('c='.$ctl.'&m='.$act.$str_params);
} 

?>